package com.xieshue.im.client;

import java.util.Scanner;

/**
 * @author xieshue
 * @date 2017\12\28 0028
 */
public class Client {

    public static void main(String[] args) {
        String username = null, password = null;

        Scanner scanner = new Scanner(System.in);
        try {
//            while (!loginSuccess(username, password)) {
//                System.out.println("默认用户名:谢蜀鄂，默认密码:1234");
//                System.out.println("请输入用户名:");
//                username = scanner.nextLine();
//                if (StringUtils.hasText(username)) {
//                    System.out.println("请输入密码:");
//                    password = scanner.nextLine();
//                    if (!loginSuccess(username, password)) {
//                        System.out.println("登录失败！");
//                    }
//                }
//            }
//            System.out.println("登录成功");
            new ImClientBootstrap(new ConnectConfig(8081)).connect();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static boolean loginSuccess(String username, String password) {
        return username != null && "谢蜀鄂".equals(username) && password != null && "1234".equals(password);
    }
}
